package com.uum.blog.pojo.vo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;
import java.util.Set;

@Data
public class CommentVO implements Serializable {
    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "评论主键ID")
    @TableId(value = "comment_id", type = IdType.AUTO)
    private Long commentId;

    @NotNull
    @ApiModelProperty(value = "博文的id")
    private Long blogId;

    @NotNull
    @ApiModelProperty(value = "评论者的id")
    private Long fromId;

    @NotNull
    @ApiModelProperty(value = "评论的内容")
    private String content;

    @ApiModelProperty(value = "父级评论 root-0")
    private Long parentId;

    @ApiModelProperty(value = "被评论者id")
    private Long toId;

    @ApiModelProperty(value = "点赞的数量")
    private Integer likeCount;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;

    @ApiModelProperty(value = "评论者的昵称")
    private String fromName;

    @ApiModelProperty(value = "被评论者昵称")
    private String toName;

    private List<CommentVO> replyList; //子评论的集合

    private Set userLikeCollection;    //点赞的用户ID集合
}
